package com.wuxiaofan.coupon.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaofan.coupon.entity.SmsSeckillSkuRelation;
import com.wuxiaofan.coupon.entity.custom.SmsSeckillSkuRelationCustom;
import com.wuxiaofan.coupon.mapper.SmsSeckillSkuRelationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuxiaofan.coupon.client.Idgenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

@Service
public class SmsSeckillSkuRelationService {
    @Autowired
    private SmsSeckillSkuRelationMapper smsSeckillSkuRelationMapper;
    @Resource
    private Idgenerator idgenerator;
    public SmsSeckillSkuRelation findById(String id){
        return smsSeckillSkuRelationMapper.selectById(id);
    }

    public SmsSeckillSkuRelationCustom findCountByMap(Map paraMap){
        return smsSeckillSkuRelationMapper.findCountByMap(paraMap);
    }

    public SmsSeckillSkuRelationCustom findGroupByMap(Map paraMap){
        return smsSeckillSkuRelationMapper.findGroupByMap(paraMap);
    }

    public List<SmsSeckillSkuRelationCustom> findByMap(Map paraMap){
        return smsSeckillSkuRelationMapper.findByMap(paraMap);
    }

    public Page<SmsSeckillSkuRelationCustom> findByMap(Map paraMap, Page page){
        return page.setRecords(smsSeckillSkuRelationMapper.findByMap(paraMap,page));
    }


    public void updateMapById(Map paraMap){
        smsSeckillSkuRelationMapper.updateMapById(paraMap);
    }
    public void delById(String id){
        smsSeckillSkuRelationMapper.deleteById(id);
    }

    public SmsSeckillSkuRelation save(SmsSeckillSkuRelation smsSeckillSkuRelation){
        smsSeckillSkuRelation.setId(idgenerator.getId());
        smsSeckillSkuRelationMapper.insert(smsSeckillSkuRelation);
        return smsSeckillSkuRelation;
    }

}
